<%-- 
    Document   : adminPage
    Created on : Sep 22, 2012, 8:35:03 AM
    Author     : lion
--%>

<%@page import="sun.text.normalizer.UBiDiProps"%>
<%@page import="java.util.ArrayList"%>
<%@page import="java.util.Iterator"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@page import="dao.*,entities.*" %>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <script type="text/javascript" src="../../js/jquery-1.7.2.min.js"></script>
        <script type="text/javascript" src="../../js/jquery.validate.min.js"></script>
        <script type="text/javascript" src="../../js/toggle.js"></script>
        <link  href="../style.css" rel="stylesheet" type="text/csss"/>
        <script  type="text/javascript">
            $(document).ready(function(){
                $("#frmSendMsg").validate();
            });
        </script>
        <style type="text/css">
            table{
                border-collapse:collapse;
                width: 100%;
                text-align: center;
            }
            table,th, td
            {
                border: 1px solid black;
            }
            th{
                height: 50px;
            }
        </style>
        <title>View feedback</title>
    </head>
    <%
        FeedbackDao fbDao = new FeedbackDao();
    %>
    <body>
        <div class="body">
            <%@include file="../template/header.html" %>
            <%@include file="../../template/displayMessage.jsp"%>
            <%@include file="sidebar.html"%>
            <div id="contentbox">
                <table>
                    <thead>
                        <tr>
                            <th>Feedback</th>
                            <th>Date</th>
                            <th>Username</th>
                        </tr>
                    </thead>
                    <%
                        MemberDao memberDao = new MemberDao();
                        StudentDao studentDao = new StudentDao();
                        for (Iterator it = fbDao.getFeedbackList().iterator(); it.hasNext();) {
                            Feedback feedbacks = (Feedback) it.next();
                            Student student = new Student();
                            student.setStudentid(feedbacks.getStudentid());
                            Member member = new Member();
                            member.setMemberid(studentDao.getMemberIdOfStudent(student));
                    %>

                    <tr>
                        <td> <%= feedbacks.getFeedbackText()%> </td>
                        <td><%= feedbacks.getDateOfPosting()%></td>
                        <td><%= memberDao.getUsernameByID(studentDao.getMemberIdOfStudent(student))%></td>
                    </tr>

                    <%}%>


                </table>

            </div>
            <div class="clear"></div>
            <%@include file="../../template/displayUser.jsp" %>
            <%@include file="../template/footer.html" %>
        </div>
    </body>
</html>
